﻿using UnityEngine;
using KingSley;
using System.Collections.Generic;

public enum PlayerStateEnum
{
    Death,
    Idle,
    Walk,
    Run,
    Hit,
    Gun,
    Attack1,
    Attack2,
    Attack3,
    Attack4
}

public struct SkillCD
{
    public string SkillName;
    public float SkillCDTime;

    public SkillCD(string skillName, float skillCDTime)
    {
        this.SkillName = skillName;
        this.SkillCDTime = skillCDTime;
    }
}

/// <summary>
/// 获取所有Animator的Parameters条件
/// </summary>
public class PlayerState : MonoSingleton<PlayerState>
{
    public PlayerStateEnum PlayerStateNow;

    public int DeathTrigger { get; private set; }
    public int IdleBool { get; private set; }
    public int WalkBool { get; private set; }
    public int RunBool { get; private set; }
    public int HitTrigger { get; private set; }
    public int GunTrigger { get; private set; }
    public int AttackInt { get; private set; }

    public SkillCD SkillCD1 = new SkillCD("Attack1", 1f);
    public SkillCD SkillCD2 = new SkillCD("Attack2", 2f);
    public SkillCD SkillCD3 = new SkillCD("Attack3", 4f);
    public SkillCD SkillCD4 = new SkillCD("Attack4", 3f);

    void Awake()
    {
        DeathTrigger = Animator.StringToHash("Death");
        IdleBool = Animator.StringToHash("Idle");
        WalkBool = Animator.StringToHash("Walk");
        RunBool = Animator.StringToHash("Run");
        HitTrigger = Animator.StringToHash("Hit");
        GunTrigger = Animator.StringToHash("Gun");
        AttackInt = Animator.StringToHash("Attack");
    }
}
